<template>
  <div class="manager">
    <!-- 用于接受管理页面，首页，订单页，我的页面 -->

   

      <router-view></router-view>


    <van-tabbar v-model="active" active-color="gold">
      <van-tabbar-item to="/manager/home">
        首页
        <template #icon="props">
          <img :src="props.active ? require('../assets/home-Actived.png') : require('../assets/home-noActived.png')" />
        </template>
      </van-tabbar-item>

      <!-- 需要修改 -->
      <van-tabbar-item to="/manager/order">
        订单
        <template #icon="props">
          <img :src="props.active ? require('../assets/order-Actived.png') : require('../assets/order-noActived.png')" />
        </template>
      </van-tabbar-item>
      <van-tabbar-item to="/manager/mine">
        我的
        <template #icon="props">
          <img :src="props.active ? require('../assets/mine-Actived.png') : require('../assets/mine-noActived.png')" />
        </template>
      </van-tabbar-item>
    </van-tabbar>
  </div>
</template>

<script>
  import {
    mapState
  } from 'vuex';
  export default {
    data() {
      return {
        active: 0,
      };
    },
    computed: {
      ...mapState("customer", ['customerInfo']),


    },
    mounted() {
      this.$store.dispatch("customer/getcustomerInfo");
      if (sessionStorage.getItem('curActive')) {
        this.active = Number(sessionStorage.getItem('curActive'))
      }

    },
  };
</script>

<style scoped>
  .van-tabbar-item img {
    width: 30px;
    height: 30px;
  }
</style>